/**
 * Created by arnold.zhu on 7/4/2017.
 */
import axios from 'axios';

class LoginService {

  login(params) {
    return new Promise((resolve, reject) => {
      axios.post('/api/login2', params).then(function (response) {
        resolve(response.data);
      }).catch(function (error) {
        reject(error);
      });
    });
  }

  logout(params) {
    return new Promise((resolve, reject) => {
      axios.post('/api/login2', params).then(function (response) {
        resolve(response.data);
      }).catch(function (error) {
        reject(error);
      });
    });
  }
}

export default new LoginService();